package com.sh.代理模式.动态代理.impl;


import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @Auther: sh
 * @Version 1.0
 * @Description:
 */
public class TimerInvocationHandler implements InvocationHandler {

    private Object target;

    public TimerInvocationHandler(Object target) {
        this.target = target;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("代理前==========================");
        Object o = method.invoke(target, args);
        System.out.println("代理后==========================");
        return o;
    }
}

